#!/bin/sh

# swoole image must contain php composer
swoole_img="swoole:4.1.2"
container_code_path="/app"
work_dir="/data/webroot"

cur_dir=$(pwd)

if [ -d ${work_dir}/easyswoole ]; then
    sudo rm -rf ${work_dir}/easyswoole
fi

Init()
{
    docker run --rm --net=host -v ${work_dir}:${container_code_path}:rw composer sh -c "composer config -g repo.packagist composer https://packagist.laravel-seconds-china.org && cd ${container_code_path} && composer create-project "fastd/dobee" dobee -vvv"
}

Install()
{
    docker run --rm --net=host -v ${work_dir}:${container_code_path}:rw composer sh -c "cd ${container_code_path}/dobee && composer install -vvv"
}

Init
Install